package edu.drexel.cs575.a3.location;

public class LocationProvider {
	private static final LocationProvider instance = new LocationProvider();

	private LocationProvider() {
	}

	public static LocationProvider getInstance() {
		return instance;
	}

	public Location getLocation() {
		LocaleEnum localeEnum = LocaleProvider.getInstance().getLocaleEnum();
		LocationFactory factory = null;

		switch (localeEnum) {
		case MOON:
			factory = MoonLocationFactory.getInstance();
			break;

		default:
			factory = EarthLocationFactory.getInstance();
		}
		
		return factory.createLocation(localeEnum);
	}
}
